<html>
<head>
<link rel='stylesheet' href='../../js/sh/SyntaxHighlighter.css' type='text/css' />
<script src='../../js/sh/shCore.js'></script>
<script src='../../js/sh/shBrushJava.js'></script>
<style>
* {
font-family:Courier New,monospace;
  padding: 0;
  margin: 0;
  white-space: nowrap;
  font-size: 11px;
}
.dp-highlighter {
  white-space: nowrap;
  overflow: visible;
  width: 600px;
  font-size: 11px;
  font-family:Courier New,monospace;
}
</style>
</head>
<body>
<textarea name='code' class='java:nogutter' rows='15' cols='120'>
/*
 * SmartGWT (GWT for SmartClient)
 * Copyright 2008 and beyond, Isomorphic Software, Inc.
 *
 * SmartGWT is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License version 3
 * as published by the Free Software Foundation.  SmartGWT is also
 * available under typical commercial license terms - see
 * http://smartclient.com/license
 *
 * This software is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
 * Lesser General Public License for more details.
 */

import com.smartgwt.client.types.SelectionType;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.ImgButton;
import com.smartgwt.client.widgets.layout.VLayout;
import com.smartgwt.client.widgets.toolbar.ToolStrip;

public class ButtonRadioToggleSample implements EntryPoint {

    public void onModuleLoad() {
        ToolStrip toolStrip = new ToolStrip();
        toolStrip.setWidth(200);
        toolStrip.setHeight(24);

        ImgButton boldButton = new ImgButton();
        boldButton.setSize(24);
        boldButton.setShowRollOver(false);
        boldButton.setSrc("icons/24/text_bold.png");
        boldButton.setActionType(SelectionType.CHECKBOX);
        toolStrip.addMember(boldButton);
        
        ImgButton italicsButton = new ImgButton();
        italicsButton.setSize(24);
        italicsButton.setShowRollOver(false);
        italicsButton.setSrc("icons/24/text_italics.png");
        italicsButton.setActionType(SelectionType.CHECKBOX);
        toolStrip.addMember(italicsButton);
        
        ImgButton underlineButton = new ImgButton();
        underlineButton.setSize(24);
        underlineButton.setShowRollOver(false);
        underlineButton.setSrc("icons/24/text_underlined.png");
        underlineButton.setActionType(SelectionType.CHECKBOX);
        toolStrip.addMember(underlineButton);
        
        ImgButton alignLeftButton = new ImgButton();
        alignLeftButton.setSize(24);
        alignLeftButton.setShowRollOver(false);
        alignLeftButton.setSrc("icons/24/text_align_left.png");
        alignLeftButton.setActionType(SelectionType.RADIO);
        alignLeftButton.setRadioGroup("textAlign");
        toolStrip.addMember(alignLeftButton);
        
        ImgButton alignRightButton = new ImgButton();
        alignRightButton.setSize(24);
        alignRightButton.setShowRollOver(false);
        alignRightButton.setSrc("icons/24/text_align_right.png");
        alignRightButton.setActionType(SelectionType.RADIO);
        alignRightButton.setRadioGroup("textAlign");
        toolStrip.addMember(alignRightButton);
        
        ImgButton alignCenterButton = new ImgButton();
        alignCenterButton.setSize(24);
        alignCenterButton.setShowRollOver(false);
        alignCenterButton.setSrc("icons/24/text_align_center.png");
        alignCenterButton.setActionType(SelectionType.RADIO);
        alignCenterButton.setRadioGroup("textAlign");
        toolStrip.addMember(alignCenterButton);
        
        VLayout layout = new VLayout();
        layout.setAutoHeight();
        layout.addMember(toolStrip);
        layout.draw();
    }

}
</textarea>
<script class='javascript'>
dp.SyntaxHighlighter.HighlightAll("code");
</script>
</body>
</html>
